home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Picasso Interactive Demo / Data / manimaj.dxr / Internal_61_Sc.InitManitool.ls < prev    next >
Encoding:
Text File  |  1996-12-02  |  3.5 KB  |  132 lines

  1. on InitLoupe
  2.   global NomImage, NomRep, gDel
  3.   set pl to NomImage & "L"
  4.   loadpalette(pl)
  5.   updateStage()
  6. end
  7.  
  8. on InitEchelle
  9.   global NomImage, NomRep, gListeMMajeur, gDel
  10.   set pl to NomImage & "E"
  11.   loadpalette(pl)
  12.   set lmajpos to getPos(gListeMMajeur, NomImage)
  13.   if lmajpos <> 0 then
  14.     set vname to NomImage & "AP.JPG"
  15.     set numref to getAt(gListeMMajeur, lmajpos + 3)
  16.     set cname to "M" & NomImage & "EC" & ".RTF"
  17.   end if
  18. end
  19.  
  20. on InitZoom
  21.   global NomImage, NomRep, gDel
  22. end
  23.  
  24. on RollManitool
  25.   global ManiList, MEnCours, gCurMaj
  26.   set spritenum to 0
  27.   if rollOver(11) then
  28.     set spritenum to 11
  29.   else
  30.     if rollOver(12) then
  31.       set spritenum to 12
  32.     else
  33.       if rollOver(13) then
  34.         set spritenum to 13
  35.       else
  36.         if rollOver(14) then
  37.           set spritenum to 14
  38.         else
  39.           if rollOver(15) then
  40.             set spritenum to 15
  41.           else
  42.             if rollOver(16) then
  43.               set spritenum to 16
  44.             else
  45.               if rollOver(17) then
  46.                 set spritenum to 17
  47.               end if
  48.             end if
  49.           end if
  50.         end if
  51.       end if
  52.     end if
  53.   end if
  54.   if spritenum = 0 then
  55.     cursor(-1)
  56.     set the castNum of sprite 44 to the number of member "Roll Dummy"
  57.     set the locH of sprite 44 to -10
  58.     set the locV of sprite 44 to -10
  59.   else
  60.     if (spritenum = 13) and (the visible of sprite 13 = 0) then
  61.     else
  62.       if (ManiList <> []) and (MEnCours = 0) then
  63.         if getPos(ManiList, "spr" & spritenum) > 0 then
  64.           cursor(gCurMaj)
  65.           set cname to getAt(ManiList, getPos(ManiList, "spr" & spritenum) - 1) & "On"
  66.           if the castNum of sprite 48 <> the number of member cname then
  67.             set the castNum of sprite 44 to the number of member ("Nom" & getAt(ManiList, getPos(ManiList, "spr" & spritenum) - 1))
  68.             set the locH of sprite 44 to 495
  69.             set the locV of sprite 44 to 12
  70.             updateStage()
  71.           end if
  72.         end if
  73.       end if
  74.     end if
  75.   end if
  76. end
  77.  
  78. on InitPicto
  79.   global ManiList
  80.   puppetSprite(16, 1)
  81.   puppetSprite(17, 1)
  82.   set the castNum of sprite 16 to 0
  83.   set the castNum of sprite 17 to 0
  84.   if ManiList <> [] then
  85.     if getPos(ManiList, "spr16") > 0 then
  86.       set namecst to getAt(ManiList, getPos(ManiList, "spr16") - 1) & "Off"
  87.       set the castNum of sprite 16 to the number of member namecst
  88.       set the locH of sprite 16 to getAt(ManiList, getPos(ManiList, "spr16") + 1)
  89.       set the locV of sprite 16 to getAt(ManiList, getPos(ManiList, "spr16") + 2)
  90.     end if
  91.     if getPos(ManiList, "spr17") > 0 then
  92.       set namecst to getAt(ManiList, getPos(ManiList, "spr17") - 1) & "Off"
  93.       set the castNum of sprite 17 to the number of member namecst
  94.       set the locH of sprite 17 to getAt(ManiList, getPos(ManiList, "spr17") + 1)
  95.       set the locV of sprite 17 to getAt(ManiList, getPos(ManiList, "spr17") + 2)
  96.     end if
  97.   end if
  98.   updateStage()
  99. end
  100.  
  101. on wait nbsec
  102.   startTimer()
  103.   repeat while the timer < ((charToNum(nbsec) - 48) * 60)
  104.     if the mouseDown then
  105.       exit repeat
  106.     end if
  107.   end repeat
  108. end
  109.  
  110. on waitfor nbtip
  111.   startTimer()
  112.   repeat while the timer < nbtip
  113.     if the mouseDown then
  114.       exit repeat
  115.     end if
  116.   end repeat
  117. end
  118.  
  119. on loadpalette name
  120.   global g_xlib_xpal
  121.   if (the colorDepth = 8) or (the machineType = 256) then
  122.     duplicate(cast name of castLib "palmaj", 146)
  123.     puppetPalette(146, 60, 1)
  124.     updateStage()
  125.     duplicate(cast 146, 145)
  126.     puppetPalette(145, 60, 1)
  127.     updateStage()
  128.     puppetPalette(146, 60, 1)
  129.     updateStage()
  130.   end if
  131. end
  132.